<?php
namespace Admin\Controller;
use Think\Auth;
use Think\Controller;
class AdminController extends Controller{
    protected function _initialize(){
//         define('UID',1);
        define('UID',isLogin());
        if(!UID) $this->redirect('Admin/User/login');    
//         if(!$this->checkAuth()) $this->error('你没有权限','Index/index');
    }
    
    protected function checkAuth($url='',$uid=UID){
        static $Auth;
        if(!$Auth) $Auth=new Auth();
        $url=$url ? $url : strtolower(MODULE_NAME.'/'.CONTROLLER_NAME.'.'/ACTION_NAME);
        return $Auth->check($url,$uid);
    }
}